load("//tools:defaults.bzl", "ng_module", "ts_devserver")

package(default_visibility = ["//modules/playground:__subpackages__"])

ng_module(
    name = "images",
    srcs = glob(["**/*.ts"]),
    assets = ["image_demo.html"],
    tsconfig = "//modules/playground:tsconfig-build.json",
    deps = [
        "//packages/core",
        "//packages/platform-webworker",
        "//packages/platform-webworker-dynamic",
        "@npm//@types/base64-js",
    ],
)

ts_devserver(
    name = "devserver",
    # Workaround for: https://github.com/bazelbuild/rules_typescript/issues/409
    additional_root_paths = ["angular"],
    bootstrap = [
        "//packages/zone.js/dist:zone.js",
        "@npm//:node_modules/jquery/dist/jquery.min.js",
        "@npm//:node_modules/materialize-css/dist/js/materialize.min.js",
    ],
    entry_module = "angular/modules/playground/src/web_workers/images/index",
    port = 4200,
    scripts = ["@npm//:node_modules/tslib/tslib.js"],
    static_files = [
        "@npm//:node_modules/base64-js/base64js.min.js",
        "@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
        "@npm//:node_modules/tslib/tslib.js",
        "@npm//:node_modules/materialize-css/dist/css/materialize.min.css",
        "loader.js",
        "index.html",
        "//modules/playground/src/web_workers:worker-config",
        "//third_party/github.com/google/material-design-icons",
    ] + glob(["**/*.css"]),
    deps = [":images"],
)
